package com.example.demo.service;

import com.example.demo.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;
    @Transactional(propagation = Propagation.REQUIRED)
    public void updateDbb(){
        this.update();
        this.update_new();

    }

    @Transactional(propagation = Propagation.REQUIRED)
    public void update(){
        userMapper.update(93);

    }
    @Transactional(propagation = Propagation.NEVER)
    public void update_new(){
        userMapper.update2(92);

    }
}
